﻿package 第一章.currentThreadExt;

public class CountOperate extends Thread {

	public CountOperate() {
		System.out.println("CountOperate---begin");
		System.out.println("Thread.currentThread().getName()=" + Thread.currentThread().getName());
		// this代表当前CountOperate对象，getName没有复写，所以调用Thread的getName方法，返回 "Thread-" + nextThreadNum()
		System.out.println("this.getName()=" + this.getName());
		System.out.println("CountOperate---end");
	}

	@Override
	public void run() {
		System.out.println("run---begin");
		// 返回当前线程的name，t.setName("A");已经修改了线程名字
		System.out.println("Thread.currentThread().getName()=" + Thread.currentThread().getName());
		// this代表当前CountOperate对象，getName没有复写，所以调用Thread的getName方法，返回 "Thread-" + nextThreadNum()
		System.out.println("this.getName()=" + this.getName());
		System.out.println("run---end");
	}

}
